<?php

namespace app\modules\client\models;

/**
 * Created by PhpStorm.
 * User: Yueool
 * Date: 2018/6/29
 * Time: 15:27
 */
class Request{


    public static function getRequest($id){
        $db = \Yii::$app->db;
        $request = $db->createCommand("SELECT `id`, `cid`, `name` ,`domain`, `uri`, `method` FROM `pre_request` WHERE id=".$id)->queryOne();
        $request["params"] = $db->createCommand("SELECT `id`, `rid`, `name` ,`necessary`, `type`, `default`, `intro` FROM `pre_request_param` WHERE rid=".$id." AND `status`=1")->queryAll();
        return $request;
    }

}